package com.llkj.qingnianguoxue.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.llkj.qingnianguoxue.R;
import com.llkj.qingnianguoxue.bean.CircleListBean;
import com.llkj.qingnianguoxue.util.ImageLoadingUtil;

import java.util.List;

/**
 * 圈子详情适配器
 */
public class GroupDetailAdapter extends BaseQuickAdapter<CircleListBean.CircleBean, BaseViewHolder> {

    public GroupDetailAdapter(int layoutResId, List<CircleListBean.CircleBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, CircleListBean.CircleBean item) {
        ImageView ivCirclePic = baseViewHolder.getView(R.id.ivCirclePic);
        if(baseViewHolder.getLayoutPosition()==mData.size()-1){
            baseViewHolder.setText(R.id.tvCircleName, "邀请");
            ivCirclePic.setImageResource(R.drawable.icon_create_circle);
        }else{
            baseViewHolder.setText(R.id.tvCircleName, item.getUsername());
            ImageLoadingUtil.loadingCircleBorderImg(ivCirclePic,item.getUserpic(), R.color.transparent);
        }
    }

}
